<?php


namespace App\Http\Controllers\Admin;


use App\Tool\Json;

class RouteController extends AuthCheckController
{

    /**
     *
     * Create by Peter
     * 2019/09/11 16:15:00
     * Email:904801074@qq.com
     * @return false|string
     */
    function getRouteTip(){

        $keyword=request()->input('keyword',null);

        if(!$keyword) return Json::code(1,'no match',[]);

        $uriList=[];
        foreach (\Route::getRoutes() as $v){


            $uri=$v->uri;


            if(explode('/',$uri)[0]!='admin') continue;

            if(!stristr($uri,$keyword)) continue;

            $uriList[]=['value'=>'/'.$uri];

        }

        return Json::code(1,'success',$uriList);
    }

}
